//企业简历详情基本信息
import React, { Component } from 'react'
import {
    View,
    Text,
} from 'react-native';

import { Cresumeexperience_Style as styles } from '../../../../styles';
import Icon from 'react-native-vector-icons/Ionicons';
import fmt from '../../../util/fmtDateUtil';

export default class Cexperience_list extends Component {
    constructor(props) {
        super(props);
    }
    render() {
        if (this.props.jobExp != undefined) {
            return (
                <View style={styles.exp_centerall}>
                    <View style={styles.exp_eve1}>
                        <View style={styles.exp_circle}></View>
                        <Text style={styles.exp_pos}>
                            {this.props.jobExp.jobexpPostion}
                        </Text>
                        <View style={styles.exp_small}>
                            <Text style={styles.exp_txt1}>{this.fieldName(this.props.jobExp.fields, 3)}</Text>
                        </View>
                    </View>

                    <View style={styles.exp_onebottom}>
                        <View style={styles.exp_eve2}>
                            <Text style={styles.exp_com}>{this.props.jobExp.jobexpCompanyName}</Text>
                            <Text style={styles.exp_txt1}>（{this.props.jobExp.jobexpWorkspace}）</Text>
                        </View>

                        <View style={styles.exp_eve3}>
                            <Icon
                                name={'md-calendar'}
                                size={18}
                                color={'#aeaeae'} style={styles.exp_timeicon} />
                            <Text style={styles.exp_time}>{fmt(this.props.jobExp.jobexpBeginTime,'yyyy-MM-dd')}</Text>
                            <Text style={styles.exp_time2}>-</Text>
                            <Text style={styles.exp_time}>{fmt(this.props.jobExp.jobexpEndTime,'yyyy-MM-dd')}</Text>
                            {/* <Text style={styles.exp_time3}>（2个月）</Text> */}
                        </View>

                        <Text style={styles.exp_eve4}>{this.props.jobExp.jobexpDuty}</Text>

                    </View>
                </View >
            )
        } else {
            return null;
        }
    }
    //经营领域
    fieldName(List, sl) {
        let arr = '';
        if (List != undefined) {
            let s = sl;
            let length = List.length;
            if (length <= s) {
                s = length;
            }
            for (let i = 0; i < s; i++) {
                arr += List[i].fieldName + '/';
            }
            if (arr.endsWith('/')) {
                arr = arr.substr(0, arr.length - 1);
            }
        }
        return arr;
    }
}